Jehan [Tue, 4 Jul 2017 12:05:34 +0000 (14:05 +0200)]
configure: do not link with pthread on Android.
It turns out Bionic (Android C library) has its own implementation of
pthread. With this minor change, babl is fully cross-compilable for
Android.
Ell [Fri, 23 Jun 2017 11:30:40 +0000 (07:30 -0400)]
palette: make the conversion hash table volatile
... to avoid the theoretical possiblity of hash table entires being
read more than once during conversion, defying atomicity. Very,
*very* paranoid, but what the hell :P
Ell [Wed, 21 Jun 2017 17:53:08 +0000 (13:53 -0400)]
palette: make palette conversion thread safe
Conversion from RGBA u8 to an 8-bit palette format caches conversion
results in a hash table, belonging to the palette model. Currently,
manipulation of the hash table is not thread safe -- when multiple
threads convert to the same palette format concurrently, the result
may be wrong. In particular, there is a race condition when two
different colors that share the same hash are converted concurrently.
Fix this by changing the hash table layout, so that it can be
modified atomically. We assume that aligned 32-bit writes are
atomic.
Note that the new layout is only suitable for palettes with up to
256 colors, but this is all we use the hash table for ATM anyway.
Add a regression test.
Jehan [Fri, 16 Jun 2017 14:33:46 +0000 (16:33 +0200)]
extensions: just some minor cleaning of trailing whitespaces.
Øyvind Kolås [Tue, 13 Jun 2017 07:23:43 +0000 (09:23 +0200)]
babl-internal: tidy up some log messages
Guiu Rocafort [Tue, 13 Jun 2017 07:21:29 +0000 (09:21 +0200)]
bug #783704, Check db NULL to avoid segfault if babl not initiated,
Ell [Sun, 11 Jun 2017 22:56:18 +0000 (18:56 -0400)]
tests: fix typo in hsva.c
"rgba to hsva" -> "hsva to rgba"; got swapped by commit
c8b5eee3f86a49bd093929f0bd16ef780de88c67. Thanks to Edward_E for
catching that.
Ell [Thu, 8 Jun 2017 13:20:29 +0000 (09:20 -0400)]
Bug 780016 - Conversion path between nonpremultiplied formats ...
.. may pass through a premultiplied format, losing color information
of fully transparent pixels
Add a few pixels with zero alpha to the test pixels array, to penalize
such paths. 16 pixels seem to be enough for the conversions tested,
using the default tolerance.
Add a regression test.
Ell [Thu, 8 Jun 2017 13:09:42 +0000 (09:09 -0400)]
babl-gen-test-pixels: update floating-point format of output ...
... to match commit
37947d19cd217ef5a04da46627a60ccde8925122.
Ell [Thu, 8 Jun 2017 13:02:35 +0000 (09:02 -0400)]
tests: add CHECK_CONV_FLOAT to common.inc
Like CHECK_CONV, but for floating point destination types.
Use CHECK_CONV_FLOAT in hsva.c and hsl.c, instead of custom
CHECK_CONV implementations. To be used by another test soon.
Øyvind Kolås [Tue, 30 May 2017 21:48:07 +0000 (23:48 +0200)]
post release version bump
Øyvind Kolås [Tue, 30 May 2017 21:39:50 +0000 (23:39 +0200)]
release 0.1.28
Øyvind Kolås [Mon, 15 May 2017 20:05:21 +0000 (22:05 +0200)]
extensions: add two fast paths from cairo formats
This is to babls corresponding premultiplied but in different swizzling order
8bit and float data.
Ell [Tue, 9 May 2017 23:16:29 +0000 (19:16 -0400)]
CIE: add Lab <-> LCH fast paths
Øyvind Kolås [Tue, 9 May 2017 17:03:04 +0000 (19:03 +0200)]
configure.ac: post-release version bump
Øyvind Kolås [Tue, 9 May 2017 16:30:34 +0000 (18:30 +0200)]
configure: 0.1.26 release
Øyvind Kolås [Tue, 9 May 2017 16:30:16 +0000 (18:30 +0200)]
NEWS: update for 0.1.26
SBP [Thu, 4 May 2017 13:10:04 +0000 (15:10 +0200)]
Make HCY conversions symmetric.
Øyvind Kolås [Fri, 28 Apr 2017 13:45:24 +0000 (15:45 +0200)]
Revert "HCY: add build bits neccesary for compilation"
This reverts commit
82195e28e3d9f733216f364d20719b213367515f.
The HCY extensions is not ready for use, since the model does not provide
symmmetric conversions. Disabling build and install of it.
pippin@yogi:~/src/babl/tests$ BABL_PATH=../extensions/.libs ./models
HCYA
test: 0.713 -0.170 -0.020 0.033
clipped: -0.505 6.011 -0.259 0.033
trnsfrmd: 137.334 -0.503 10.838 0.033
HCYA
test: 0.335 0.130 -0.029 -0.066
clipped: 0.335 0.130 -0.029 -0.066
trnsfrmd: 0.335 0.130 -0.029 -0.066
HCYA
test: 0.455 0.145 0.287 0.409
clipped: 0.455 0.145 0.287 0.409
trnsfrmd: 0.455 0.145 0.287 0.409
HCYA
test: 0.689 -0.154 -0.011 0.077
clipped: -0.413 3.381 -0.223 0.077
trnsfrmd: 55.965 -0.372 4.757 0.077
HCYA is not symmetric
HCY
test: 0.713 -0.170 -0.020 0.033
clipped: -0.505 6.011 -0.259 1.000
trnsfrmd: 137.334 -0.503 10.838 1.000
HCY
test: 0.335 0.130 -0.029 -0.066
clipped: 0.335 0.130 -0.029 1.000
trnsfrmd: 0.335 0.130 -0.029 1.000
HCY
test: 0.455 0.145 0.287 0.409
clipped: 0.455 0.145 0.287 1.000
trnsfrmd: 0.455 0.145 0.287 1.000
HCY
test: 0.689 -0.154 -0.011 0.077
clipped: -0.413 3.381 -0.223 1.000
trnsfrmd: 55.965 -0.372 4.757 1.000
HCY is not symmetric
Øyvind Kolås [Fri, 28 Apr 2017 13:19:10 +0000 (15:19 +0200)]
HCY: add build bits neccesary for compilation
Elle Stone [Sat, 28 Jan 2017 14:15:33 +0000 (09:15 -0500)]
Remove white space from CIE and group code
sections according to precision to make it easier for people to
figure out which lines of code go with which types of conversions.
Edward E [Fri, 7 Apr 2017 06:47:45 +0000 (01:47 -0500)]
babl-cache: fix previous cache file persisting on Win32
Cygwin's rename() won't overwrite an existing file, so remove() it first
Øyvind Kolås [Wed, 15 Mar 2017 21:36:12 +0000 (22:36 +0100)]
do not print missing fast path message when tolerance is very small
During the build of examples for GEGL when hashes are being cheched, the
BABL_TOLERANCE is set to 0.0 on purpose. Complaints about missing fast-paths
here are noise.
Victor Ananjevsky [Sun, 12 Mar 2017 19:01:38 +0000 (20:01 +0100)]
fish-cache: fix cache path on linux
make babl on linux honor $XDG_CACHE_HOME variable, falling back to using
$HOME/.cache
Øyvind Kolås [Thu, 9 Feb 2017 11:46:55 +0000 (12:46 +0100)]
use non gcc-specific floating point notation
As reported in bug #778072 - HP UX ANSI C compiler refuses to compile
the shorthand floating point constant spec used by babl. Regenerated
file of constants by Richard Loyd <rkl@connect.org.uk>
Øyvind Kolås [Thu, 9 Feb 2017 11:44:07 +0000 (12:44 +0100)]
bug #778071 improve portability to hp-ux native compiler
Øyvind Kolås [Tue, 31 Jan 2017 23:34:33 +0000 (00:34 +0100)]
post release version bump
Øyvind Kolås [Tue, 31 Jan 2017 23:29:08 +0000 (00:29 +0100)]
configure.ac: 0.1.24 release
Øyvind Kolås [Tue, 31 Jan 2017 23:02:42 +0000 (00:02 +0100)]
babl: generate db in temporary file
Fixing some of - but not all race conditions shown by concurrency stress test.
Jehan [Sat, 28 Jan 2017 19:11:35 +0000 (20:11 +0100)]
docs: s/ftp/https/ and s/downloads/download/ on the download location.
Øyvind Kolås [Sat, 28 Jan 2017 19:04:24 +0000 (20:04 +0100)]
docs: update download location
Øyvind Kolås [Fri, 13 Jan 2017 11:32:10 +0000 (12:32 +0100)]
util: add float versions of non optimized TRC functions
Øyvind Kolås [Fri, 13 Jan 2017 10:02:11 +0000 (11:02 +0100)]
pow-24: use own inlined frexpf implementation
Cannot beat sqrtf which can be an inlined instruction, but the function call
overhead of frexpf can be eliminated.
Øyvind Kolås [Fri, 13 Jan 2017 02:45:35 +0000 (03:45 +0100)]
extensions/CIE: do cbrt computation in single precision float
This is sufficient for our purposes, and gives a ~40% boost for
the affecte CIE Lab float conversions.
Øyvind Kolås [Fri, 13 Jan 2017 02:45:06 +0000 (03:45 +0100)]
extensions/CIE: use cbrtf from musl instead of libm
The inlining alone gives a ~6% performance boost.
Øyvind Kolås [Thu, 12 Jan 2017 20:39:11 +0000 (21:39 +0100)]
extensions/CIE: make some constants single precision float
Speeds up the 32bit float versions of conversions by a bit more than 5% without
changing the precision of 32bit floating point since the constants are of
similar magnitude to single precision IEEE float.
Øyvind Kolås [Tue, 3 Jan 2017 17:00:29 +0000 (18:00 +0100)]
extensions: enable a couple more simple float<->double paths
Øyvind Kolås [Sat, 31 Dec 2016 19:26:35 +0000 (20:26 +0100)]
make fish hashes less likely to fail
Øyvind Kolås [Sat, 31 Dec 2016 18:15:29 +0000 (19:15 +0100)]
hash-table: simplify integer hashing
Øyvind Kolås [Fri, 16 Dec 2016 14:01:34 +0000 (15:01 +0100)]
configure: make the f16c test for half-float instructions stricter
Øyvind Kolås [Fri, 16 Dec 2016 00:43:34 +0000 (01:43 +0100)]
extensions/cairo: implement cairo display path from YA float
Øyvind Kolås [Fri, 16 Dec 2016 00:01:43 +0000 (01:01 +0100)]
extensions/cairo: implement rgb8 to cairo32, speeding up RGB linear half display
Øyvind Kolås [Thu, 15 Dec 2016 23:39:08 +0000 (00:39 +0100)]
extensions: add fast paths going from gray to premul alpha rgb - for resampling
Øyvind Kolås [Thu, 15 Dec 2016 23:16:42 +0000 (00:16 +0100)]
tools/babl-verify: print the substeps of chosen paths
Øyvind Kolås [Thu, 15 Dec 2016 22:01:02 +0000 (23:01 +0100)]
babl-verify.sh: rm cache before running
Øyvind Kolås [Thu, 15 Dec 2016 20:01:45 +0000 (21:01 +0100)]
cairo: add fast paths for u8 and u16 gray gamma
Øyvind Kolås [Thu, 15 Dec 2016 16:39:50 +0000 (17:39 +0100)]
babl-fish-path: permit searching for one step longer fish paths
but only if no BABL_PATH_LENGTH long or shorter valid paths were found,
this enables some desirable 16bit integer and floating point conversions.
Øyvind Kolås [Thu, 15 Dec 2016 16:39:28 +0000 (17:39 +0100)]
babl-verify.sh: add CIE Lab formats to verification
Øyvind Kolås [Thu, 15 Dec 2016 15:43:07 +0000 (16:43 +0100)]
babl-verify.sh: only recompile extensions, not tools
Øyvind Kolås [Thu, 15 Dec 2016 15:40:28 +0000 (16:40 +0100)]
tools: add shell script to aid in development of fast paths
Added a shell script which takes a base format and profiles/debugs relevant
babl conversions for this format. The script recompiles the extensions
folder.
Usage:
$ babl ./tools/babl-verify.sh "RGBA half"
to get information about fast paths for half precision floating point, as
used by GEGL/GIMP.
Øyvind Kolås [Thu, 15 Dec 2016 15:40:02 +0000 (16:40 +0100)]
tools/babl-verify: print selected fast path if a third argument is provided
Øyvind Kolås [Thu, 15 Dec 2016 12:03:10 +0000 (13:03 +0100)]
extensions: implement bitshifting swizzlers for cairo/u8
Øyvind Kolås [Thu, 15 Dec 2016 01:41:32 +0000 (02:41 +0100)]
extensions/sse2-float: add gamma and premul as single step
Øyvind Kolås [Thu, 15 Dec 2016 01:24:26 +0000 (02:24 +0100)]
sse2-int8: permit converting premultiplied gamma RGBA
Øyvind Kolås [Thu, 15 Dec 2016 01:08:46 +0000 (02:08 +0100)]
extensions/cairo: regain some lost speed for 32bit linear float display
Øyvind Kolås [Thu, 15 Dec 2016 00:34:53 +0000 (01:34 +0100)]
extensions/fast-float: temporarily disable
Disable this floating point LUT for now, it treats negative values as their
positive counterparts, see bug #776113.
Øyvind Kolås [Tue, 13 Dec 2016 20:50:56 +0000 (21:50 +0100)]
babl: return tolerance to 0.000001
Smallest value printable with default %f printf format, conversions have been
iterated on sufficiently to crank up the precision again.
Øyvind Kolås [Sun, 11 Dec 2016 21:13:25 +0000 (22:13 +0100)]
babl: make missing fast path message explicit
Explicit, and mandatory for BABL_UNSTABLE.
Øyvind Kolås [Sun, 11 Dec 2016 18:31:40 +0000 (19:31 +0100)]
extensions/cairo: add faster paths for 8bit and 16bit gamma grayscale
Øyvind Kolås [Sat, 10 Dec 2016 18:41:39 +0000 (19:41 +0100)]
babl-fish-path: add debug print message when no fast paths were found
Messages get printed when the environment variable BABL_DEBUG_CONVERSIONS is
set, which also inhibits loading of babl fish cache.
Øyvind Kolås [Sat, 10 Dec 2016 15:27:08 +0000 (16:27 +0100)]
extensions/add shorter fast path for half gray
Øyvind Kolås [Sat, 10 Dec 2016 15:10:45 +0000 (16:10 +0100)]
extensions/simple: improve u16 fast paths
Øyvind Kolås [Fri, 9 Dec 2016 21:21:48 +0000 (22:21 +0100)]
extensions/simple: add u16 fast paths
Øyvind Kolås [Fri, 9 Dec 2016 21:17:15 +0000 (22:17 +0100)]
extensions/simple: reuse some fast paths for more component counts
Øyvind Kolås [Fri, 9 Dec 2016 19:07:47 +0000 (20:07 +0100)]
extensions/simple: implement some 32bit integer fast paths
Øyvind Kolås [Fri, 9 Dec 2016 13:26:31 +0000 (14:26 +0100)]
extensions: speed up 8bit gray scale for GIMP
Øyvind Kolås [Thu, 8 Dec 2016 19:03:27 +0000 (20:03 +0100)]
extensions/16bit: add a couple 16 bit alpha adding fast paths
Edward E [Fri, 2 Dec 2016 00:39:11 +0000 (18:39 -0600)]
babl-cache: implement a better cache path on Win32
Use SHGetFolderPathA() to get the user local data path
(the same path GEGL uses for plugins on Win32)
https://bugzilla.gnome.org/show_bug.cgi?id=774491
Øyvind Kolås [Wed, 30 Nov 2016 00:43:45 +0000 (01:43 +0100)]
babl-cache: fix mk_ancestry to return 0 when behaving properly
Øyvind Kolås [Tue, 29 Nov 2016 21:53:13 +0000 (22:53 +0100)]
babl-cache: use babl version in header for releases
Øyvind Kolås [Tue, 29 Nov 2016 21:45:56 +0000 (22:45 +0100)]
babl-cache: factor out construction of header line
Øyvind Kolås [Tue, 29 Nov 2016 21:16:17 +0000 (22:16 +0100)]
post release version bump
Øyvind Kolås [Tue, 29 Nov 2016 21:04:31 +0000 (22:04 +0100)]
configure.ac: 0.1.22 release
Øyvind Kolås [Mon, 28 Nov 2016 11:14:45 +0000 (12:14 +0100)]
rename define for default BABL_TOLERANCE to match envvar
Jehan [Thu, 24 Nov 2016 03:31:49 +0000 (04:31 +0100)]
babl-cache: just some styling fix.
Saw some light, and some trailing whitespaces, or some indentation
not following the usual styling, and I fixed it.
Edward E [Wed, 23 Nov 2016 22:33:29 +0000 (16:33 -0600)]
babl, babl-cache: enable cache write, fix cache path processing
1. babl.c/babl_exit(): Remove fixme to enable babl cache writing on windows.
2. babl-cache.c/mk_ancestry(): pass the modified path to mk_ancestry_iter().
Edward E [Wed, 23 Nov 2016 20:35:39 +0000 (14:35 -0600)]
babl-verify: fix win32 compile, with s/setenv/putenv/g
Wouldn't compile on windows because putenv() takes 1 arg, not 2.
Win32 has no setenv(), pippin said try using putenv() on all platforms.
Øyvind Kolås [Wed, 23 Nov 2016 19:45:43 +0000 (20:45 +0100)]
babl-cache: use clearer arithmetic for dropping 1% of cached fishes
Øyvind Kolås [Wed, 23 Nov 2016 10:36:28 +0000 (11:36 +0100)]
babl-cache: incorporate BABL_PATH_LENGTH in header
Øyvind Kolås [Wed, 23 Nov 2016 10:28:24 +0000 (11:28 +0100)]
babl-cache: rearrange per fish data
Øyvind Kolås [Tue, 22 Nov 2016 21:53:36 +0000 (22:53 +0100)]
babl-cache: remove win32 bail at start of loading code
Edward E [Tue, 22 Nov 2016 19:50:34 +0000 (20:50 +0100)]
babl-cache: Add a #define for FALLBACK_CACHE_PATH
Also return fallback cache path if failing to create location for constructed
path.
Øyvind Kolås [Tue, 22 Nov 2016 19:44:37 +0000 (20:44 +0100)]
mk_ancestry: propagate return value
Øyvind Kolås [Mon, 21 Nov 2016 12:44:51 +0000 (13:44 +0100)]
babl-verify: make it compile on win32, by making setenv use putenv
Øyvind Kolås [Mon, 21 Nov 2016 12:42:55 +0000 (13:42 +0100)]
babl-cache: expect newline trouble on win32
Øyvind Kolås [Sun, 20 Nov 2016 21:39:05 +0000 (22:39 +0100)]
fish_cache_path(): simplify through use stack instead of heap
Øyvind Kolås [Sun, 20 Nov 2016 17:17:52 +0000 (18:17 +0100)]
babl-cache: use getenv("TEMP") for folder location on win32, and fix mk_ancestry
Inspired by initial work in patch for bug 774491 provided by Edward E
Øyvind Kolås [Sun, 20 Nov 2016 13:36:46 +0000 (14:36 +0100)]
fast-float: tweak precision so that float->8bit tests pass without issue
Øyvind Kolås [Sun, 20 Nov 2016 12:28:43 +0000 (13:28 +0100)]
babl-cache: avoid %'ing by 0
Øyvind Kolås [Sun, 20 Nov 2016 11:36:36 +0000 (12:36 +0100)]
babl-verify: set a high tolerance, avoid censoring some underperforming fast paths
Øyvind Kolås [Sat, 19 Nov 2016 19:08:28 +0000 (20:08 +0100)]
two-table: add RGBA float to R'G'B'A u8
Øyvind Kolås [Sat, 19 Nov 2016 19:08:16 +0000 (20:08 +0100)]
fast-float: add RGBA float to R'G'B'A u8
Øyvind Kolås [Sat, 19 Nov 2016 17:27:06 +0000 (18:27 +0100)]
make pow implementations inlineable - gaining some fixed amount of blitting performance
Øyvind Kolås [Sat, 19 Nov 2016 18:38:14 +0000 (19:38 +0100)]
fast-float: fix regression introduced when reindenting
Øyvind Kolås [Sat, 19 Nov 2016 18:22:10 +0000 (19:22 +0100)]
remove babl-fish-stats
Øyvind Kolås [Sat, 19 Nov 2016 17:50:27 +0000 (18:50 +0100)]
gegl-fixups: indentation
Øyvind Kolås [Sat, 19 Nov 2016 17:50:11 +0000 (18:50 +0100)]
fast-float: indentation
Øyvind Kolås [Sat, 19 Nov 2016 17:14:11 +0000 (18:14 +0100)]
remove bablfishpath
Øyvind Kolås [Sat, 19 Nov 2016 14:29:48 +0000 (15:29 +0100)]
cairo: reorder memory reads to be linear
Øyvind Kolås [Sat, 19 Nov 2016 14:21:20 +0000 (15:21 +0100)]
fast-float: improve memory access order